#include "comm.hpp"
int main()
{
    //创建
    int n=mkfifo(FIFO_NAME,MODE);
    if(n==-1)
    {
        perror("mkfifo");
        exit(1);
    }

    //打开
   int fd= open(FIFO_NAME,O_WRONLY);
   if(fd<0)exit(3);
    //通信
    const char*message="i am process A\n";
    write(fd,message,strlen(message));
   //关闭
   close(fd);

//删除
    int retu=unlink(FIFO_NAME);
    if(retu==-1)
    {
        perror("unlink");
        exit(2);
    }
    return 0;
}